FROM openjdk:8-jdk-alpine
VOLUME ["/tmp"]
ARG JAR_FILE
ARG JAVA_OPTS
ADD ${JAR_FILE} /app/app.jar
COPY configure-agent-run.sh /usr/local/bin/
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN dos2unix /usr/local/bin/configure-agent-run.sh
RUN chmod a+x /usr/local/bin/configure-agent-run.sh
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add --update curl && rm -rf /var/cache/apk/*
WORKDIR /app/
ENTRYPOINT ["/usr/local/bin/configure-agent-run.sh"]